// Windows/ResourceString.cpp

#include "StdAfx.h"

#include "ResourceString.h"

namespace Common {
namespace String {

CString LoadString(HINSTANCE hInstance, UINT resourceID)
{
  CString s;
  int size = 256;
  int len;
  do
  {
    size += 256;
    len = ::LoadString(hInstance, resourceID, s.GetBuffer(size - 1), size);
  }
  while (size - len <= 1);
  s.ReleaseBuffer();
  return s;
}

CString LoadString(UINT resourceID)
{
  return LoadString(_AtlBaseModule.GetModuleInstance(), resourceID);
}

}
}
